<%-- 
    Document   : reserveSejour
    Created on : 27 juil. 2008, 17:03:34
    Author     : noel
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Confirmation de réservation</title>
    </head>
    <body>        
     <f:view>
         <h:form>
             <h1>Reservation : <h:outputLabel value="#{SessionBean.selectedHotel.nom}"/> à <h:outputLabel value="#{SessionBean.selectedVille.nom}"/> pour la période:
                    du <h:outputLabel value="#{SessionBean.currentPeriode.dateDebut}"><f:convertDateTime pattern="dd/MM/yyyy" /></h:outputLabel> au 
                    <h:outputLabel value="#{SessionBean.currentPeriode.dateFin}"><f:convertDateTime pattern="dd/MM/yyyy" /></h:outputLabel></h1>
             <h:messages id="erreur" layout="list" errorClass="error" infoClass="confirm"/>
             <fieldset>
                 <legend>Confirmation des dates et du type de chambre</legend>
                 <table><tr><td>Date d'entrée : </td><td><h:inputText value="#{SessionBean.reservation.dateEntree}" required="true" requiredMessage="Date d'entrée obligatoire"><f:convertDateTime pattern="dd/MM/yyyy" /></h:inputText></td></tr>
                 <tr><td>Date de sortie : </td><td><h:inputText value="#{SessionBean.reservation.dateSortie}" required="true" requiredMessage="Date de sortie obligatoire"><f:convertDateTime pattern="dd/MM/yyyy" /></h:inputText></td></tr>
                 <tr><td>Type de chambre : </td><td><h:selectOneMenu value="#{SessionBean.selectedTypeChambre}" converter="TypeChambreConverter" immediate="true">
                                         <f:selectItems value="#{SessionBean.listeTypeChambre}"/>
                                     </h:selectOneMenu></td>
                 <td><h:commandButton value="Calculer le total" action="#{SessionBean.clicTotal}"/></td></tr>
             <tr><td><h:outputLabel value="Total : #{SessionBean.total} €" /></td><td><h:commandButton value="Confirmer" action="#{SessionBean.clicConfirmeTotal}" rendered="#{SessionBean.total != 0}"/></td></tr></table>
             </fieldset>
             
         <h:panelGroup rendered="#{SessionBean.confirmTotal == true}">
             <fieldset>
                 <legend>Vos informations</legend>
                 <table><tr><td>
                 Nom: </td><td><h:inputText value="#{SessionBean.client.nom}" required="true" requiredMessage="Nom obligatoire"/></td></tr><tr><td>
                 Prenom: </td><td><h:inputText value="#{SessionBean.client.prenom}" required="true" requiredMessage="Prenom obligatoire"/><br></td></tr><tr><td>
                 Adresse : </td><td><h:inputText value="#{SessionBean.client.adresse}" required="true" requiredMessage="Adresse obligatoire"/></td></tr></table>
             </fieldset><br>         
             <h:commandButton value="Confirmer la reservation" action="#{SessionBean.clicReservation}" rendered="#{SessionBean.total != 0}"/>
         </h:panelGroup>
         </h:form>
     </f:view>
    </body>
</html>
